//
//  LHYTimer.h
//  WanLian
//
//  Created by 123456 on 2018/12/13.
//  Copyright © 2018 wanlian. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef void (^RecallBlock) (void);
NS_ASSUME_NONNULL_BEGIN

@interface LHYTimer : NSObject

/**
 定时器类方法创建 立即开启
 */
+ (instancetype)timerWithTimeInterval:(NSTimeInterval)ti
                               target:(id)aTarget
                             selector:(SEL)aSelector
                              repeats:(BOOL)yesOrNo;

/**
 定时器类方法创建 指定开启时间
 */
+ (instancetype)timerWithFireTime:(NSTimeInterval)start
                         interval:(NSTimeInterval)ti
                           target:(id)aTarget
                         selector:(SEL)aSelector
                          repeats:(BOOL)yesOrNo;

+ (instancetype)timeWithTimeInterval:(NSTimeInterval)ti
                             repeats:(BOOL)yesOrNo
                            callBack:(RecallBlock)callBack;

- (instancetype)init UNAVAILABLE_ATTRIBUTE;
+ (instancetype)new UNAVAILABLE_ATTRIBUTE;

- (void) fire;
- (void) invalidate;
@property (readonly) BOOL repeats;
@property (readonly) NSTimeInterval timeInterval;
@property (readonly, getter=isValid) BOOL valid;

@end

NS_ASSUME_NONNULL_END
